<?php 

$status	= $this->formTextarea('status',"",array('class'=>'txtmedium', 'rows' => '4','placeholder'=>"chia sÃ¡ÂºÂ» trÃ¡ÂºÂ¡ng thÃƒÂ¡i cÃ¡Â»Â§a bÃ¡ÂºÂ¡n!"));
$linkImg = FILES_URL.'/users/img45x45/';

$user1 = $this->userCurrent ;


//CREATE SEARCH AREA
$keywords = $this->formText('keywords',"",array('class'=>'txtshort'));
$linkSearch = $this->baseUrl($this->currentController . '/search-friend/typeSearch/search/key/1');
$btnSearch = $this->formButton('search-now','Search now',
		array('onclick'=>"OnSubmitForm('" . $linkSearch . "')"));
$linkResetSearch = $this->baseUrl($this->currentController . '/search-friend/typeSearch/search/key/0');
$btnResetSearch = $this->formButton('clear-keywords','Clear',
		array('onclick'=>"OnSubmitForm('" . $linkResetSearch . "','class'=>'button-search')"));
$strSearch = $keywords . ' ' . $btnSearch . ' ' . $btnResetSearch;


?>
<div class="process" id="process">
	<img alt="" src="<?php echo $this->imgUrl.'/processing.gif'?>">
</div>
<div class="container">
	<div class="right-container">
		<?php echo $this->render('index/categories/rightNavigation.php')?>
	</div>
	<div class="search-friend-container">
		<form name="appForm" method="post" action=""
			enctype="multipart/form-data">
			<div class="label-display-all">
				<b>Danh sách những người dùng trong hệ thống!</b> </br></br>
				<span style="font-size: 14px;font-weight:bold">Tìm kiếm bạn </span><?php echo $strSearch;?>
			</div>
			<hr style="width: 90%">
			<ul>
				<?php foreach($this->Items as $key=>$value){ ?>
				<li>
					<?php if(!empty($value['user_avatar'])) {?>
						<img alt="" src="<?php echo $linkImg.$value['user_avatar']?>" style="border:1px solid #ccc;border-radius:4px"/>
					<?php }else{ ?>
						<img alt="" src="<?php echo $linkImg.'no-img.png'?>"style="border:1px solid #ccc;border-radius:4px" />
					<?php }?>
					<div class="user-name">
						<a href="#"> <?php echo $value['user_name']?></a>
					</div>
					<?php if(in_array($value['id'], $this->friendList)) {?>
						<a  class="friended"  ></a>
					<?php }else {?>
						<div id="addFriend<?php echo $value['id']?>" onclick="requestAdd('<?php echo $this->baseUrl($this->currentController)?>/add-friend/request/add/user2/<?php echo $value['id'] ?>',addFriend<?php echo $value['id']?>)" class="add-friend-button"  ></div>
					<?php }?>
				</li>
				<?php } ?>
			</ul>

		</form>

	</div>
	<!-- BEGIN: PAGINATION (FOOT) -->
	<div style="float: right; margin-right: 160px; margin-top: 10px;">
		<?php 
		$currentUrl = $this->baseUrl($this->currentController . '/search-friend');
		echo $this->paginationControl($this->panigator,'Sliding','pagination.phtml',array('currentUrl'=>$currentUrl));
		?>
	</div>
	<!-- END: PAGINATION (FOOT) -->


	<?php echo $this->render('index/categories/index.phtml')?>
</div>
